package cn.enilu.guns.service.door;


import cn.enilu.guns.bean.entity.door.UserCard;
import cn.enilu.guns.bean.vo.query.SearchFilter;
import cn.enilu.guns.dao.door.UserCardRepository;

import cn.enilu.guns.service.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserCardService extends BaseService<UserCard,Long,UserCardRepository>  {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private UserCardRepository userCardRepository;

    public List<UserCard> queryByCondition(String cardNo,String isUnbinding){
        SearchFilter filter = new SearchFilter("cardNo", SearchFilter.Operator.EQ,cardNo);
        SearchFilter filterIsUnbinding = new SearchFilter("isUnbinding", SearchFilter.Operator.EQ,isUnbinding);
        List<SearchFilter> filters = new ArrayList<>();
        filters.add(filter);
        filters.add(filterIsUnbinding);
        return this.queryAll(filters);
    }

}

